home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
System Booster
/
System Booster.iso
/
Systemmonitors
/
RSys
/
RSysSrc.lha
/
RSysInit.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-09-25
|
19KB
|
517 lines
/*
***************************************************************************
*
* Datei:
* RSysInit.c
*
* Inhalt:
*
* --- Globale Routinen ---
*
* int OpenSysWindow ( void );
* long CreateMainGadgets ( void );
* void ResizeWindowRefresh ( void );
*
* --- Lokale Routinen ---
*
* static void AdjustLVLines ( void );
* static void ReCalcLVHeight ( struct Screen *Scr );
*
* Bemerkungen:
* Initialisierung des Hauptfensters von RSys.
*
* Erstellungsdatum:
* 07-Jul-93 Rolf Böhme
*
* Änderungen:
* 07-Jul-93 Rolf Böhme Erstellung
*
***************************************************************************
*/
#include "RSys.h"
static UWORD SysGTypes[] = {
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
BUTTON_KIND,
LISTVIEW_KIND,
TEXT_KIND,
TEXT_KIND,
BUTTON_KIND
};
static int tops[20] =
{
117, 117, 117, 117,
131, 131, 131, 131,
145, 145, 145, 145,
159, 159, 159, 159,
16,
2,
102, 102
};
int LVH = 85, WndH = 183, SysMinH = 132;
static struct NewGadget SysNGad[] = {
{5 ,117,93+NEWLEN,12, (UBYTE *)"_Tasks",NULL,GD_TasksGad,PLACETEXT_IN,NULL,NULL},
{125,117,93+NEWLEN,12,(UBYTE *)"_Libraries",NULL,GD_LibrariesGad,PLACETEXT_IN,NULL,NULL},
{245,117,93+NEWLEN,12,(UBYTE *)"_Memory",NULL,GD_MemoryGad,PLACETEXT_IN,NULL,NULL},
{365,117,93+NEWLEN,12,(UBYTE *)"_Ports",NULL,GD_PortsGad,PLACETEXT_IN,NULL,NULL},
{5 ,131,93+NEWLEN,12, (UBYTE *)"_Volumes",NULL,GD_VolumesGad,PLACETEXT_IN,NULL,NULL},
{125,131,93+NEWLEN,12,(UBYTE *)"_Assigns",NULL,GD_AssignsGad,PLACETEXT_IN,NULL,NULL},
{245,131,93+NEWLEN,12,(UBYTE *)"_Fonts",NULL,GD_FontsGad,PLACETEXT_IN,NULL,NULL},
{365,131,93+NEWLEN,12,(UBYTE *)"_Ressources",NULL,GD_ResourcesGad,PLACETEXT_IN,NULL,NULL},
{5 ,145,93+NEWLEN,12, (UBYTE *)"_Interrupts",NULL,GD_InterruptsGad,PLACETEXT_IN,NULL,NULL},
{125,145,93+NEWLEN,12,(UBYTE *)"_Windows",NULL,GD_WindowsGad,PLACETEXT_IN,NULL,NULL},
{245,145,93+NEWLEN,12,(UBYTE *)"_Screens",NULL,GD_ScreensGad,PLACETEXT_IN,NULL,NULL},
{365,145,93+NEWLEN,12,(UBYTE *)"_HandlerInp",NULL,GD_HandlerInpGad,PLACETEXT_IN,NULL,NULL},
{5 ,159,93+NEWLEN,12, (UBYTE *)"S_ystem",NULL,GD_SystemGad,PLACETEXT_IN,NULL,NULL},
{125,159,93+NEWLEN,12,(UBYTE *)"Har_dware",NULL,GD_HardwareGad,PLACETEXT_IN,NULL,NULL},
{245,159,93+NEWLEN,12,(UBYTE *)"Save List",NULL,GD_SaveListGad,PLACETEXT_IN,NULL,NULL},
{365,159,93+NEWLEN,12,(UBYTE *)"_Jump",NULL,GD_JumpGad,PLACETEXT_IN,NULL,NULL},
{5,16,477,85, (UBYTE *)NULL,NULL,GD_ListeLV,0,NULL,NULL},
{5,2,477,12, (UBYTE *)NULL,NULL,GD_TextHeader,0,NULL,NULL},
{5,102,438,13, (UBYTE *)NULL,NULL,GD_InfoMsgGad,0,NULL,NULL},
{446,102,35,13,(UBYTE *)"_New",NULL,GD_NewGad,PLACETEXT_IN,NULL,NULL}
};
extern struct List ListeLVList;
int newlvh;
static const ULONG *SysGTags[] = {
(ULONG *)(GT_Underscore), (ULONG *)'_', (ULONG *)(TAG_DONE),
(ULONG *)(GT_Underscore), (ULONG *)'_', (ULONG *)(TAG_DONE),
(ULONG *)(GT_Underscore), (ULONG *)'_', (ULONG *)(TAG_DONE),
(ULONG *)(GT_Underscore), (ULONG *)'_', (ULONG *)(TAG_DONE),
(ULONG *)(GT_Underscore), (ULONG *)'_', (ULONG *)(TAG_DONE),
(ULONG *)(GT_Underscore), (ULONG *)'_', (ULONG *)(TAG_DONE),
(ULONG *)(GT_Underscore), (ULONG *)'_', (ULONG *)(TAG_DONE),
(ULONG *)(GT_Underscore), (ULONG *)'_', (ULONG *)(TAG_DONE),
(ULONG *)(GT_Underscore), (ULONG *)'_', (ULONG *)(TAG_DONE),
(ULONG *)(GT_Underscore), (ULONG *)'_', (ULONG *)(TAG_DONE),
(ULONG *)(GT_Underscore), (ULONG *)'_', (ULONG *)(TAG_DONE),
(ULONG *)(GT_Underscore), (ULONG *)'_', (ULONG *)(TAG_DONE),
(ULONG *)(GT_Underscore), (ULONG *)'_', (ULONG *)(TAG_DONE),
(ULONG *)(GT_Underscore), (ULONG *)'_', (ULONG *)(TAG_DONE),
(ULONG *)(TAG_DONE),
(ULONG *)(GT_Underscore), (ULONG *)'_', (ULONG *)(TAG_DONE),
(ULONG *)(GTLV_Labels), (ULONG *)&ListeLVList, (ULONG *)(TAG_DONE),
(ULONG *)(GTTX_Text), (ULONG *)NULL,(ULONG *)(GTTX_Border), (ULONG *)TRUE, (ULONG *)(TAG_DONE),
(ULONG *)(GTTX_Text), (ULONG *)NULL,(ULONG *)(GTTX_Border), (ULONG *)TRUE,(ULONG *)(TAG_DONE),
(ULONG *)(GT_Underscore), (ULONG *)'_', (ULONG *)(TAG_DONE),
};
/* -----------------------------------------------------------
struct Library *KeymapBase = NULL;
void
test(void)
{
int a = 1, b = 0;
a = a / b;
/* MapANSI((STRPTR)"huhu",4L,(STRPTR)"huhu",4L, NULL);
}
/* ----------------------------------------------------------- */
struct NewMenu SysNewMenu[]=
{
/* 00 */ {NM_TITLE, (UBYTE *) "Project", NULL, 0, 0, NULL,},
/* 01 */ {NM_ITEM, (UBYTE *) "Iconify, <ESC>", (UBYTE *) "I", 0, 0, Iconify,},
/* 02 */ {NM_ITEM, (UBYTE *) "Help", (UBYTE *) "H", CHECKIT | MENUTOGGLE, 0, Help,},
/* 03 */ {NM_ITEM, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 04 */ {NM_ITEM, (UBYTE *) "Status", NULL, 0, 0, ShowStatus,},
/* 05 */ {NM_ITEM, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 06 */ {NM_ITEM, (UBYTE *) "Save Configuration", NULL, 0, 0, SaveConfig,},
/* 07 */ {NM_ITEM, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 08 */ {NM_ITEM, (UBYTE *) "About...", (UBYTE *) "A", 0, 0, About,},
/* 09 */ {NM_ITEM, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 10 */ {NM_ITEM, (UBYTE *) "Quit " NAME "...", (UBYTE *) "Q", 0, 0, quit,},
/* 11 */ {NM_TITLE, (UBYTE *) "Other Lists", NULL, 0, 0, NULL,},
/* 12 */ {NM_ITEM, (UBYTE *) "Exec", NULL, 0, 0, NULL,},
/* 13 */ {NM_SUB, (UBYTE *) "Software Devices", (STRPTR)"1", 0, 0, SysSoftDeviceList,},
/* 14 */ {NM_SUB, (UBYTE *) "Vectors", (STRPTR)"2", 0, 0, SysVectorList,},
/* 15 */ {NM_SUB, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 16 */ {NM_SUB, (UBYTE *) "CLI processes", NULL, 0, 0, SysCLIList,},
/* 17 */ {NM_SUB, (UBYTE *) "Semaphores", NULL, 0, 0, SysSemaphoreList,},
/* 18 */ {NM_SUB, (UBYTE *) "Memory areas", NULL, 0, 0, RSysMemoryAreaList,},
/* 19 */ {NM_ITEM, (UBYTE *) "DOS", NULL, 0, 0, NULL,},
/* 20 */ {NM_SUB, (UBYTE *) "Volume locks", (STRPTR)"3", 0, 0, RSysLockList,},
/* 21 */ {NM_SUB, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 22 */ {NM_SUB, (UBYTE *) "Resident programs", NULL, 0, 0, SysResidentProg,},
/* 23 */ {NM_SUB, (UBYTE *) "Physical Devices", NULL, 0, 0, SysResidentList,},
/* 24 */ {NM_SUB, (UBYTE *) "Fault messages", NULL, 0, 0, RSysFaultMessages,},
/* 25 */ {NM_ITEM, (UBYTE *) "Graphics", NULL, 0, 0, NULL,},
/* 26 */ {NM_SUB, (UBYTE *) "Display modes", (STRPTR)"4", 0, 0, RSysGetDisplayModes,},
/* 27 */ {NM_SUB, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 28 */ {NM_SUB, (UBYTE *) "Blitter Wait Queue", NULL, 0, 0, SysBlitterWaitList,},
/* 29 */ {NM_SUB, (UBYTE *) "TOF Wait Queue", NULL, 0, 0, SysTOFWaitList,},
/* 30 */ {NM_ITEM, (UBYTE *) "Diskfont", NULL, 0, 0, NULL,},
/* 31 */ {NM_SUB, (UBYTE *) "Fonts in FONTS:", (STRPTR)"5", 0, 0, SysAvailFontsList,},
/* 32 */ {NM_ITEM, (UBYTE *) "Intuition", NULL, 0, 0, NULL,},
/* 33 */ {NM_SUB, (UBYTE *) "Public Screens", (STRPTR)"6", 0, 0, SysPubScreenList,},
/* 34 */ {NM_SUB, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 35 */ {NM_SUB, (UBYTE *) "Gadgets", NULL, 0, 0, RSysGadgetList,},
/* 36 */ {NM_ITEM, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 37 */ {NM_ITEM, (UBYTE *) "Preferences", NULL, 0, 0, NULL,},
/* 38 */ {NM_SUB, (UBYTE *) "Preferences Data", (STRPTR)"7", 0, 0, SysPrefList,},
/* 39 */ {NM_SUB, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 40 */ {NM_SUB, (UBYTE *) "Printer data", NULL, 0, 0, SysExtPrinterData,},
/* 41 */ {NM_SUB, (UBYTE *) "ENV-Variables", NULL, 0, 0, SysEnvList,},
/* 42 */ {NM_ITEM, (UBYTE *) "Other libraries", NULL, 0, 0, NULL,},
/* 43 */ {NM_SUB, (UBYTE *) "Commodities", (STRPTR)"8", 0, 0, SysBrokerList,},
/* 44 */ {NM_SUB, (UBYTE *) "Amigaguide XRef", (STRPTR)"9", 0, 0, RSysAmigaGuideRefList,},
/* 45 */ {NM_TITLE, (UBYTE *) "Actions", NULL, 0, 0, NULL,},
/* 46 */ {NM_ITEM, (UBYTE *) "CRC Check...", NULL, 0, 0, CRCSum,},
/* 47 */ {NM_ITEM, (UBYTE *) "Crypt File...", NULL, 0, 0, CryptFile,},
/* 48 */ {NM_ITEM, (UBYTE *) "List Hunks...", NULL, 0, 0, HunkStruct,},
/* 49 */ {NM_ITEM, (UBYTE *) "Find File...", NULL, 0, 0, FindFile,},
/* 50 */ {NM_ITEM, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 51 */ {NM_ITEM, (UBYTE *) "Format Disk...", NULL, 0, 0, FormatDisk,},
/* 52 */ {NM_ITEM, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 53 */ {NM_ITEM, (UBYTE *) "Save windows...", NULL, 0, 0, SaveWindows,},
/* 54 */ {NM_ITEM, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 55 */ {NM_ITEM, (UBYTE *) "Check Libraries", NULL, 0, 0, SysCheckOffs,},
/* 56 */ {NM_TITLE, (UBYTE *) "Internal List", NULL, 0, 0, NULL,},
/* 57 */ {NM_ITEM, (UBYTE *) "Save current list", (UBYTE *) "L", 0, 0, SaveCurrentList,},
/* 58 */ {NM_ITEM, (UBYTE *) "Restore saved list", (UBYTE *) "R", 0, 0, RestoreList,},
/* 59 */ {NM_ITEM, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 60 */ {NM_ITEM, (UBYTE *) "Kill saved list", NULL, 0, 0, KillList,},
/* 61 */ {NM_TITLE, (UBYTE *) "Flushing", NULL, 0, 0, NULL,},
/* 62 */ {NM_ITEM, (UBYTE *) "Flush libraries", NULL, 0, 0, RSysFlushAllLibraries,},
/* 63 */ {NM_ITEM, (UBYTE *) "Flush fonts", NULL, 0, 0, RSysFlushAllFonts,},
/* 64 */ {NM_ITEM, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 65 */ {NM_ITEM, (UBYTE *) "Flush all libraries and fonts", NULL, 0, 0, RSysFlushAll,},
/* 66 */ {NM_TITLE, (UBYTE *) "Clip", NULL, 0, 0, NULL,},
/* 67 */ {NM_ITEM, (UBYTE *) "Clip entry...", (UBYTE *)"C", 0, 0, RSysEntryToClip,},
/* 68 */ {NM_ITEM, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 69 */ {NM_ITEM, (UBYTE *) "Clip list", NULL, 0, 0, RSysListToClip,},
/* 70 */ {NM_TITLE, (UBYTE *) "Flags", NULL, 0, 0, NULL,},
/* 71 */ {NM_ITEM, (UBYTE *) "Fast Mode", (UBYTE *) "F", CHECKIT | CHECKED | MENUTOGGLE, 0, ToggleFastMode,},
/* 72 */ {NM_ITEM, (UBYTE *) "Sorting", (UBYTE *) "O", CHECKIT | CHECKED | MENUTOGGLE, 0, ToggleSortMode,},
/* 73 */ {NM_ITEM, (UBYTE *) "Working bar", (UBYTE *) "B", CHECKIT | MENUTOGGLE, 0, ToggleWorkingBar,},
/* 74 */ {NM_ITEM, (UBYTE *) "Auto front window", (UBYTE *) "Z", CHECKIT | MENUTOGGLE, 0, ToggleAutoFront,},
/* 75 */ {NM_ITEM, (UBYTE *) "Mouse window", (UBYTE *) "M", CHECKIT | MENUTOGGLE, 0, ToggleMouseWindow,},
/* 76 */ {NM_ITEM, (UBYTE *) "Topaz Font", (UBYTE *) "T", CHECKIT | MENUTOGGLE, 0, ToggleTopazFont,},
/* 77 */ {NM_ITEM, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 78 */ {NM_ITEM, (UBYTE *) "Speaking", NULL, CHECKIT | MENUTOGGLE, 0, ToggleSpeakMode,},
/* 79 */ {NM_ITEM, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 80 */ {NM_ITEM, (UBYTE *) "Save asking", NULL, CHECKIT | CHECKED | MENUTOGGLE, 0, ToggleAskingMode,},
/* 81 */ {NM_ITEM, (UBYTE *) "Text formatter", NULL, CHECKIT | CHECKED | MENUTOGGLE, 0, ToggleTextFormatter,},
/* 82 */ {NM_TITLE, (UBYTE *) "Ext. Data", NULL, 0, 0, NULL,},
/* 83 */ {NM_ITEM, (UBYTE *) "Reload action file...", 0, 0, 0, BuildActionList,},
/* 84 */ {NM_ITEM, (UBYTE *) "Reload hardware datas...", 0, 0, 0, BuildHardwareList,},
/* 85 */ {NM_ITEM, (UBYTE *) "Reload library offsets...", 0, 0, 0, BuildLibOffsetList,},
/* 86 */ {NM_ITEM, (UBYTE *) "Reload AGuide context nodes...", 0, 0, 0, BuildHelpList,},
/* 87 */ {NM_TITLE, (UBYTE *) "Search", NULL, 0, 0, NULL,},
/* 88 */ {NM_ITEM, (UBYTE *) "Find next", (UBYTE *) "N", 0, 0, RSysFindNext,},
/* 89 */ {NM_ITEM, (UBYTE *) "Find previous", (UBYTE *) "P", 0, 0, RSysFindPrev,},
/* 90 */ {NM_ITEM, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
/* 91 */ {NM_ITEM, (UBYTE *) "Search string...", (UBYTE *) "S", 0, 0, RSysSearch,},
/* -----------------------------------------------------------
{NM_TITLE, (UBYTE *) "Log File", NULL, 0, 0, NULL,},
{NM_ITEM, (UBYTE *) "Open Log file", NULL, 0, 0, OpenErrorLogFile,},
{NM_ITEM, (UBYTE *) "Close Log File", NULL, 0, 0, CloseErrorLogFile,},
{NM_ITEM, (UBYTE *) NM_BARLABEL, NULL, 0, NULL, NULL,},
{NM_ITEM, (UBYTE *) "Trap handler test (for betas only!)", NULL, 0, NULL, test},
/* ----------------------------------------------------------- */
/* 71 */ {NM_END, NULL, NULL, 0, NULL, NULL}
};
static void
ReCalcLVHeight(struct Screen *Scr)
{
int i, j = 0;
newlvh = ((SysWnd->Height - (SysWnd->BorderBottom + SysWnd->BorderTop + 3) -
ComputeY((UWORD)(WndH - LVH))) / FontY) + 1;
for(i = 0; i <= Sys_CNT; i++)
if(i <= 15 || i == 18 || i == 19) SysNGad[i].ng_TopEdge = tops[i] + (newlvh - 10) * 8;
SysNGad[16].ng_Height = LVH + (newlvh - 10) * 8;
return;
}
long
CreateMainGadgets(void)
{
struct Gadget *g;
struct NewGadget ng;
UWORD lc, tc;
if (NOT(g = CreateContext(&SysGList))) return 1L;
SysGTags[50] = (ULONG *)&EntryAttr[LastID].ea_header[0];
for( lc = 0, tc = 0; lc <= Sys_CNT; lc++ )
{
CopyMem(&SysNGad[ lc ], &ng, sizeof( struct NewGadget ));
ng.ng_VisualInfo = VisualInfo;
ng.ng_TextAttr = Font;
ng.ng_LeftEdge = OffX + ComputeX( ng.ng_LeftEdge );
ng.ng_TopEdge = OffY + ComputeY( ng.ng_TopEdge);
ng.ng_Width = ComputeX( ng.ng_Width );
ng.ng_Height = ComputeY( ng.ng_Height);
SysGadgets[ lc ] = g = CreateGadgetA((ULONG)SysGTypes[ lc ], g, &ng, ( struct TagItem * )&SysGTags[ tc ] );
while( SysGTags[ tc ] ) tc += 2;
tc++;
if ( NOT g ) return 2L;
}
return 0L;
}
void
ResizeWindowRefresh(void)
{
extern void MakePattern(struct Window *);
InitListView(SysWnd,SysGadgets[GD_ListeLV],NULL,0);
RemoveGList(SysWnd, SysGList, (-1));
if (SysGList)
{
FreeGadgets(SysGList);
SysGList = NULL;
}
ReCalcLVHeight(Scr);
if(CreateMainGadgets()) ErrorHandle("CreateMainGadgets()", GADGET_ERR, CREATE_FAIL, KILL);
AddGList(SysWnd, SysGList, -1, (-1), NULL);
MakePattern(SysWnd);
RefreshMainWindowPattern();
RefreshListView();
PrintStatistics();
ClearIntuiMsgPort(SysWnd);
SysHeight = FULL * (SysWnd->Height - OffY - Scr->WBorBottom) / (FRAC * FontY);
return;
}
static void
AdjustLVLines(void)
{
ComputeFont(Scr, (UWORD)0, (UWORD)0);
if ((ComputeY(SysHeight) + OffY + Scr->WBorBottom) > Scr->Height)
do
{
newlvh--;
SysHeight -= 8;
} while(newlvh > 3 &&
(ComputeY(SysHeight) + OffY + Scr->WBorBottom) > Scr->Height);
return;
}
/*
* OpenSysWindow() öffnet das Hauptfenster von RSys
*/
int
OpenSysWindow(void)
{
UWORD wleft = SysLeft,
wtop = SysTop,
ww,
wh, smh;
int i = 0;
long gads_not_ok;
extern int winddetail,windblock,menudetail;
int gl[] = {GD_ListeLV, GD_TextHeader, GD_InfoMsgGad};
DPOS;
AdjustLVLines();
AdjustWindowDimensions(Scr, SysLeft, SysTop, SysWidth, SysHeight,
&wleft, &wtop, &ww, &wh);
smh = compute((UWORD) 0, FontY, (int)SysMinH);
smh = compute((UWORD) (OffY + Scr->WBorBottom), FontY, (int)SysMinH);
SysNewMenu[2].nm_Flags = (Flags.helpmode ? (CHECKIT | CHECKED | MENUTOGGLE) :
(CHECKIT | MENUTOGGLE)) ;
#define FFLAG 71
SysNewMenu[FFLAG].nm_Flags = (Flags.fastmode ? (CHECKIT | CHECKED | MENUTOGGLE) :
(CHECKIT | MENUTOGGLE)) ;
SysNewMenu[FFLAG+1].nm_Flags = (Flags.sortmode ? (CHECKIT | CHECKED | MENUTOGGLE) :
(CHECKIT | MENUTOGGLE)) ;
SysNewMenu[FFLAG+2].nm_Flags = (Flags.workingbar ? (CHECKIT | CHECKED | MENUTOGGLE) :
(CHECKIT | MENUTOGGLE)) ;
SysNewMenu[FFLAG+3].nm_Flags = (Flags.autofront ? (CHECKIT | CHECKED | MENUTOGGLE) :
(CHECKIT | MENUTOGGLE)) ;
SysNewMenu[FFLAG+4].nm_Flags = (Flags.mousewindow ? (CHECKIT | CHECKED | MENUTOGGLE) :
(CHECKIT | MENUTOGGLE)) ;
SysNewMenu[FFLAG+5].nm_Flags = (Flags.sysfont ? (CHECKIT | CHECKED | MENUTOGGLE) :
(CHECKIT | MENUTOGGLE));
SysNewMenu[FFLAG+7].nm_Flags = (Flags.speakmode ? (CHECKIT | CHECKED | MENUTOGGLE) :
(CHECKIT | MENUTOGGLE));
SysNewMenu[FFLAG+9].nm_Flags = (Flags.saveasking ? (CHECKIT | CHECKED | MENUTOGGLE) :
(CHECKIT | MENUTOGGLE));
SysNewMenu[FFLAG+10].nm_Flags = (Flags.textformat ? (CHECKIT | CHECKED | MENUTOGGLE) :
(CHECKIT | MENUTOGGLE));
if (NOT(SysMenus = CreateMenus(SysNewMenu, GTMN_FrontPen, menudetail, TAG_DONE)))
return 3L;
LayoutMenus(SysMenus, VisualInfo, GTMN_NewLookMenus, TRUE, GTMN_TextAttr, Font, TAG_DONE);
SysZoom[0] = 300;
SysZoom[1] = 0;
SysZoom[2] = compute((UWORD) (OffX + Scr->WBorRight), FontX, 158);
SysZoom[3] = OffY;
if (NOT(SysWnd = OpenWindowTags(NULL,
WA_Left, wleft,
WA_Top, wtop,
WA_Width, ww,
WA_MinWidth, ww,
WA_MaxWidth, ww,
WA_Height, wh,
WA_MinHeight, smh,
WA_MaxHeight, -1,
WA_DetailPen, winddetail,
WA_BlockPen, windblock,
WA_IDCMP, BUTTONIDCMP |
LISTVIEWIDCMP |
IDCMP_MOUSEBUTTONS |
IDCMP_MOUSEMOVE |
IDCMP_CLOSEWINDOW |
IDCMP_ACTIVEWINDOW |
IDCMP_INACTIVEWINDOW |
IDCMP_SIZEVERIFY |
IDCMP_NEWSIZE |
IDCMP_RAWKEY |
IDCMP_VANILLAKEY |
IDCMP_CHANGEWINDOW |
IDCMP_DISKREMOVED |
IDCMP_DISKINSERTED |
IDCMP_MENUPICK,
WA_DragBar, TRUE,
WA_DepthGadget, TRUE,
WA_CloseGadget, TRUE,
WA_SmartRefresh, TRUE,
WA_NoCareRefresh, TRUE,
WA_SizeGadget, TRUE,
WA_SizeBBottom, TRUE,
WA_Zoom, SysZoom,
WA_PubScreenName, (LONG) namebuffer,
WA_PubScreenFallBack, TRUE,
WA_PubScreen, Scr,
WA_Title, SysWdt,
WA_Dummy + 0x30, 1L,
TAG_DONE)))
return 4L;
SysZoom[0] = SysWnd->LeftEdge;
SysZoom[1] = SysWnd->TopEdge;
SysZoom[2] = SysWnd->Width;
SysZoom[3] = SysWnd->Height;
SetMenuStrip(SysWnd, SysMenus);
if(NOT(Flags.wb_start))
{
OffMenu(SysWnd, FULLMENUNUM(0,0,0));
OffMenu(SysWnd, FULLMENUNUM(0,1,0));
OffMenu(SysWnd, FULLMENUNUM(7,0,0));
OffMenu(SysWnd, FULLMENUNUM(7,3,0));
}
if(Flags.nohelp) OffMenu(SysWnd, FULLMENUNUM(0,1,0));
ReCalcLVHeight(Scr);
if(gads_not_ok = CreateMainGadgets()) return gads_not_ok;
RefreshRastPort(SysWnd, SysGadgets, gl, 3, FALSE, SysGList);
return NULL;
}